﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;

using System.Text;
using Portal.Environment;
using Portal.Language;
using Portal.Interface;

namespace Portal.CMSHistory
{
    public class HtmlHistory : Portal.Interface.WebPart
    {
        public override string WebPartId
        {
            get
            {
                return "HtmlHistory";
            }
        }

      
        public override bool IsMainWebPart
        {
            get
            {
                return false;
            }
        }

        public override bool RunStandalone
        {
            get
            {
                return false;
            }
        }

        public override string Title
        {
            get
            {
                return ResourceBLL.GetText(WebPartId,"Title","Lịch sử sửa chữa bài viết");
            }
        }

        public override string Description
        {
            get
            {
                return ResourceBLL.GetText(WebPartId,"Description","");
            }
        }


        public override Portal.Interface.WebPartInt[] SubWebParts
        {
            get
            {
                Portal.Interface.WebPartInt[] SubWebParts = new Portal.Interface.WebPartInt[]{
                    
                };
                return SubWebParts;
            }
        }


        public override string RenderWebPart(LoadParamCls loadParamCls)
        {
            try
            {
                AjaxPro.Utility.RegisterTypeForAjax(typeof(Portal.CMSHistory.HtmlHistory));
                Environments.CheckWebPartAllow(WebPartId, true);
                Environments.CheckSessionTimeOut(true);

                string RetHtmlHistory =
                    Portal.Environment.WebPartUtilities.AttachJavascript("Portal.CMS", "HtmlHistory.js") +
                    "<div class=cssHtmlHistoryMain>" +
                    "   <div id=divHtmlHistoryContent>" + GetHtmlHistory("vie", "", 0) + "</div>" +
                    "</div>";
                return RetHtmlHistory;
            }
            catch (Exception ex)
            {
                return ex.Message.ToString();
            }
        }

      
        [AjaxPro.AjaxMethod]
        public string GetHtmlHistory(string belongSite,string WorkFlowStatus, int PageIndex)
        {
            try
            {
                Environment.Environments.CheckSessionTimeOut(true);

                string RetHtmlHistory = "";
                return RetHtmlHistory;
            }
            catch (Exception ex)
            {
                return ex.Message.ToString();
            }
        }
    }
}
